package com.hzncc.flowable_diboot.rabbitmq.config;

import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.ExchangeBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitmqConfig {

    @Bean
    public Exchange delayExchange() {
        return ExchangeBuilder
                .directExchange(Cons.DELAY_EXCHANGE) // 主题交换机
                .delayed() // 开启延迟
                .durable(true) // 消息持久化
                .build();
    }


}
